package aiP.A2.Persistenz;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 * User: mizus
 * Date: 06.05.14
 * Time: 15:14
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "AI_KUNDE", schema = "HR", catalog = "")
@Entity
public class AiKundeEntity {
    private BigDecimal id;
    private String name;
    private String anschrift;
    private BigDecimal tel;
    private String kontaktperson;

    @javax.persistence.Column(name = "ID")
    @Id
    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    @javax.persistence.Column(name = "NAME")
    @Basic
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @javax.persistence.Column(name = "ANSCHRIFT")
    @Basic
    public String getAnschrift() {
        return anschrift;
    }

    public void setAnschrift(String anschrift) {
        this.anschrift = anschrift;
    }

    @javax.persistence.Column(name = "TEL")
    @Basic
    public BigDecimal getTel() {
        return tel;
    }

    public void setTel(BigDecimal tel) {
        this.tel = tel;
    }

    @javax.persistence.Column(name = "KONTAKTPERSON")
    @Basic
    public String getKontaktperson() {
        return kontaktperson;
    }

    public void setKontaktperson(String kontaktperson) {
        this.kontaktperson = kontaktperson;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AiKundeEntity that = (AiKundeEntity) o;

        if (anschrift != null ? !anschrift.equals(that.anschrift) : that.anschrift != null) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (kontaktperson != null ? !kontaktperson.equals(that.kontaktperson) : that.kontaktperson != null)
            return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (tel != null ? !tel.equals(that.tel) : that.tel != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (anschrift != null ? anschrift.hashCode() : 0);
        result = 31 * result + (tel != null ? tel.hashCode() : 0);
        result = 31 * result + (kontaktperson != null ? kontaktperson.hashCode() : 0);
        return result;
    }
}
